An apparatus for painting figures performs processing such as filling a specific region and drawing line segments in a specific section.
Such an apparatus is configured as shown in FIG. 12.
The apparatus is constituted by a painting coordinate generating section 10, which successively generates x and y coordinates at the left and right ends when filling a region and successively generates x and y coordinates at the coordinate points when drawing line segments, a painting information generating section 20 for generating painting information in response to the painting coordinate generating section 10, a buffer section 30 for temporarily storing data from the painting information generating section 20, and an address generating section 60 for generating an address for storing in a memory section 70 painting information accumulated in the buffer section 30. The memory section 70 is disposed outside the painting apparatus.
In such an apparatus, the following processing makes it possible to accumulate painting information in the memory section 70. The painting information is generated in three-dimensional processing while referring to a Z value.
FIG. 13 shows the progress of painting processing in the painting apparatus. FIG. 14 shows processing timings.
In step [S500], a Z value is loaded. The following will discuss a case of filling a triangle having an x coordinate, a y coordinate, and a Z value (depth coordinate) of (26, 7, 1), (32, 1, 1), (38, 7, 13) at the vertexes. The painting coordinate generating section 10 receives coordinate values of the triangle and a filling instruction from a painting instruction setting section (not shown). The painting coordinate generating section 10 generates an x coordinate and a y coordinate that conform to left and right ends of a filled region surrounded by triangle sides, and a corresponding Z value for each y coordinate from the vertex at the high end to the vertex at the low end of the triangle on display. The left end is computed by obtaining inclination of two vertexes of (26, 7, 1), (32, 1, 1). The right end is computed by obtaining inclination of two vertexes of (32, 1, 1), (38, 7, 13). On a first span at the high end of FIG. 13, the left and right ends conform to each other, and an x coordinate of 32, a y coordinate of 2, and a Z value of 1 are generated. Next, on a second span at the lower end, an x coordinate of 31, a y coordinate of 2, and a Z value of 1 are generated on the left end, and an x coordinate of 33, a y coordinate of 2, and a Z value of 3 are generated on the right end. A Z value between the left and right ends is computed by inclination obtained by a difference between the left and right ends. The address generating section 60 generates addresses for reading Z values corresponding to the region from the external memory section 70 and stores the addresses in the buffer section 30.
In step [S501], painting information is generated. For example, in the case of filling, a filling color is generated. In the painting information generating section 20, comparison is made between a Z value obtained from the painting coordinate generating section 10 and a Z value stored in the buffer section 30. When the newly generated Z value is on the viewpoint side, painting information is generated and is stored in the buffer section 30 as new painting information.
In step [S502], a Z value and frame memory (FM) are stored. In address generating section 60, the generated painting information in the buffer section 30 is stored in the memory section 70. This step completes the filling of a single span.
And then, the steps [S500] to [S502] are repeated on the second span and later until the last y coordinate.
However, such a conventional painting apparatus has the following problems.
As shown in FIG. 14, in order to perform a painting operation, a Z value for front-rear judgement is firstly read from the memory section 70, which is disposed outside the painting apparatus. Next, after reading, the painting information generating section 20 performs front-rear judgement for each pixel of a span, generates painting information, and stores the information in the buffer section 30. Finally, the generated painting information is written from the buffer section 30 to the memory section 70.
In case of performing the above processing, as shown in FIG. 14, access to the memory section 70 is not provided when painting information is generated, considering utilizing efficiency of a path to the memory section 70 disposed outside the painting apparatus. A path from the painting apparatus to the external memory section 70 is generally narrow. Thus, reduction in processing capability of the painting apparatus is disadvantageous in view of progress of a semiconductor.
The present invention is devised to solve the above conventional problem. The object is to provide a painting apparatus which improves painting capability better than the conventional art even when a path from the painting apparatus to the external memory section 70 is narrow.